package o;

import android.text.TextUtils;
import java.util.HashMap;
import java.util.Map;

public final class fgs {
    private static fgs ॱ = new fgs();
    private Map<String, fgt> ˋ = new HashMap();

    public static fgs ˎ() {
        return ॱ;
    }

    private fgs() {
    }

    public void ˋ(String str, Class<? extends fgo<?>> cls) {
        ˋ(str, cls, true);
    }

    public void ˋ(String str, Class<? extends fgo<?>> cls, boolean z) {
        if (cls == null) {
            throw new IllegalArgumentException("requestClass cannot be null.");
        } else if (TextUtils.isEmpty(str)) {
            throw new IllegalArgumentException("URI cannot be null.");
        } else {
            fgt o_fgt = new fgt(z);
            o_fgt.ॱ = cls;
            this.ˋ.put(str, o_fgt);
        }
    }

    public fgt ˊ(String str) {
        if (!TextUtils.isEmpty(str)) {
            return (fgt) this.ˋ.get(str);
        }
        throw new IllegalArgumentException("URI cannot be null.");
    }

    public fgo<ffc> ˏ(String str, boolean z) {
        fgt ˊ = ˊ(str);
        if (ˊ == null) {
            return null;
        }
        if (!z || ˊ.ˎ()) {
            return ˊ.ॱ();
        }
        return null;
    }
}
